<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title><?php echo $this->_tpl_vars['softtitle'] ?></title>
<link href="templates/css/baselist.css" rel="stylesheet" type="text/css" />
<link href="templates/css/all.css" rel="stylesheet" type="text/css" />
<link href="templates/css/clickmenu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/control.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodyauto")){
			$('.manageadd').css({height:h-40});
			$('.manageedit').css({height:h-40});
		}
	}
	var article_search_js_sid_err  = "<?php echo $this->_tpl_vars['ST']['article_search_js_sid_err'] ?>";
	var templatemain_js_label_code_err  = "<?php echo $this->_tpl_vars['ST']['templatemain_js_label_code_err'] ?>";
	var iframename = "<?php echo $this->_tpl_vars['iframename'] ?>";
	$(document).ready(function(){
		var h = $(window).height();
		$('.manageadd').css({height:h-40});
		var options = {
			beforeSubmit: function(){},
			success:saveResponse
		}
		$('#labelcreat').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
	})
	function saveResponse(options){
		if (options!='false'){
			$("#content").val(options);
		}else{
			alert(templatemain_js_label_code_err);
		}
	}
	function searchoption(mid,title){
		var lng=document.labelcreat.lng.value;
		selectlinkagelng('tid','index.php?archive=connected&action=sctypelist&optiontitle='+title+'&mid='+mid+'&lng='+lng);
		selectlinkagelng('sid','index.php?archive=connected&action=scsublist&optiontitle='+title+'&mid='+mid+'&lng='+lng);
		selectlinkagelng('dlidlist','index.php?archive=connected&action=doclabellist&mid='+mid);
	}
</script>
</head>

<body>
<form name="labelcreat" id="labelcreat" method="post" action="index.php?archive=templatemain&action=labeldb">
	<input type="hidden" name="inputclass" value="add">
	<input type="hidden" name="tab" id="templateaddtab" value="<?php echo $this->_tpl_vars['tab'] ?>">
	<div id="mainbodyauto" class="manageadd">
		<div class="maindobycontent">
			<!--查看已选择的类型-->
			<div class="suggestion">
				<span class="sugicon"><span class="strong colorgorning2"><?php echo $this->_tpl_vars['ST']['position_title'] ?></span><span class="colorgorningage"><?php echo $this->_tpl_vars['ST']['templatemain_add_label_mess'] ?></span></span>
			</div>
			<div class="sugtitle">
				<span class="sugtitleicon"><span class="strong colorgorning2"><?php echo $this->_tpl_vars['ST']['templatemain_add_mess_label_text'] ?></span></span>
			</div>
			<div class="sugtitle-line"></div>
			<div class="formdiv">
				<table border="0" width="100%">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01"><?php echo $this->_tpl_vars['ST']['templatemain_add_label_type'] ?></td>
						<td width="85%" class="trtitle02">
							<select size="1" name="labeltype" id="labeltype"  onChange="selectlinkagelng('labelattlist','index.php?archive=templatemain&action=attrindex&code='+this.value);">
							<?php if (count($this->_tpl_vars['lable'])>0){$divid_list=1;for($list=0;$list<count($this->_tpl_vars['lable']); $list++){?>
								<option value="<?php echo $this->_tpl_vars['lable'][$list]['code'] ?>"><?php echo $this->_tpl_vars['lable'][$list]['plugname'] ?></option>
							<?php }} ?>
							</select>
						</td>
					</tr>
				</table>
			</div>
			<div class="formdiv" id="labelattlist">
				<table border="0" width="100%">
					<tr class="trstyle2">
						<td class="trtitle01"><?php echo $this->_tpl_vars['ST']['templatemain_add_label_str'] ?></td>
						<td class="trtitle02"><?php echo $this->_tpl_vars['lablelist']['desc'] ?></td>
					</tr>
					<?php if($this->_tpl_vars['lablelist']['lng']==1){ ?>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01"><?php echo $this->_tpl_vars['ST']['article_doc_add_win_lng'] ?></td>
						<td width="85%" class="trtitle02">
							<select size="1" name="lng" id="lng" onchange="javascript:selectlinkagelng('mid','index.php?archive=connected&action=scmodellist&lng='+this.value);searchoption(1000000,'<?php echo $this->escape($this->_tpl_vars['ST']['all_botton'],'url') ?>')">
							<?php if (count($this->_tpl_vars['lnglist'])>0){$divid_list=1;for($list=0;$list<count($this->_tpl_vars['lnglist']); $list++){?>
								<option <?php echo $this->_tpl_vars['lnglist'][$list]['selected'] ?> value="<?php echo $this->_tpl_vars['lnglist'][$list]['lng'] ?>"><?php echo $this->_tpl_vars['lnglist'][$list]['lngtitle'] ?></option>
							<?php }} ?>
							</select>
						</td>
					</tr>
					<?php } ?>
					<?php if($this->_tpl_vars['lablelist']['mid']==1){ ?>
					<tr class="trstyle2">
						<td class="trtitle01"><?php echo $this->_tpl_vars['ST']['article_doc_add_win_model'] ?></td>
						<td class="trtitle02">
							<select size="1" name="mid" id="mid" onchange="javascript:searchoption(this.value,'<?php echo $this->escape($this->_tpl_vars['ST']['all_botton'],'url') ?>')">
								<option value="0"><?php echo $this->_tpl_vars['ST']['typemanage_type_add_mid_option'] ?></option>
								<?php if (count($this->_tpl_vars['modelarray'])>0){$divid_list=1;for($list=0;$list<count($this->_tpl_vars['modelarray']); $list++){?>
								<option value="<?php echo $this->_tpl_vars['modelarray'][$list]['mid'] ?>"><?php echo $this->_tpl_vars['modelarray'][$list]['modelname'] ?></option>
								<?php }} ?>
							</select>
						</td>
					</tr>
					<?php } ?>
					<?php if($this->_tpl_vars['lablelist']['tid']==1){ ?>
					<tr class="trstyle2">
						<td class="trtitle01"><?php echo $this->_tpl_vars['ST']['article_doc_add_tid'] ?></td>
						<td class="trtitle02">
							<select size="1" name="tid" id="tid">
								<option value="0"><?php echo $this->_tpl_vars['ST']['all_botton'] ?></option>
							</select>
						</td>
					</tr>
					<?php } ?>
					<?php if($this->_tpl_vars['lablelist']['sid']==1){ ?>
					<tr class="trstyle2">
						<td class="trtitle01"><?php echo $this->_tpl_vars['ST']['article_doc_add_sid'] ?></td>
						<td class="trtitle02">
							<select size="1" name="sid" id="sid">
								<option value="0"><?php echo $this->_tpl_vars['ST']['all_botton'] ?></option>
							</select>
						</td>
					</tr>
					<?php } ?>
					<?php if($this->_tpl_vars['lablelist']['dlid']==1){ ?>
					<tr class="trstyle2">
						<td class="trtitle01"><?php echo $this->_tpl_vars['ST']['viewtype_botton'] ?></td>
						<td class="trtitle02"><span id="dlidlist"><input type="radio" value="0" checked="checked" name="dlid"/> <?php echo $this->_tpl_vars['ST']['all_botton'] ?></span></td>
					</tr>
					<?php } ?>
					<?php if (count($this->_tpl_vars['lable_config'])>0){$divid_list=1;for($list=0;$list<count($this->_tpl_vars['lable_config']); $list++){?>
					<?php if($this->_tpl_vars['lable_config'][$list]['type']=='text'){ ?>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01"><?php echo $this->_tpl_vars['lable_config'][$list]['botname'] ?></td>
						<td width="85%" class="trtitle02">
							<input type="text" name="inputvalue[]" maxlength="200" size="20" value="<?php echo $this->_tpl_vars['lable_config'][$list]['value'] ?>" class="infoInput">
							<input type="hidden" name="inputname[]" value="<?php echo $this->_tpl_vars['lable_config'][$list]['name'] ?>">
							<?php if($this->_tpl_vars['lable_config'][$list]['str']!=''){ ?><span class="cautiontitle"><?php echo $this->_tpl_vars['lable_config'][$list]['str'] ?></span><?php } ?>
						</td>
					</tr>
					<?php } ?>
					<?php if($this->_tpl_vars['lable_config'][$list]['type']=='select'){ ?>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01"><?php echo $this->_tpl_vars['lable_config'][$list]['botname'] ?></td>
						<td width="85%" class="trtitle02">
							<select size="1" name="inputvalue[]">
								<?php if (count($this->_tpl_vars['lable_config'][$list]['sevalue'])>0){$divid_i=1;for($i=0;$i<count($this->_tpl_vars['lable_config'][$list]['sevalue']); $i++){?>
								<option value="<?php echo $i ?>" <?php if($this->_tpl_vars['lable_config'][$list]['value']==$i){ ?>selected<?php } ?>><?php echo $this->_tpl_vars['lable_config'][$list]['sevalue'][$i] ?></option>
								<?php }} ?>
							</select>
							<input type="hidden" name="inputname[]" value="<?php echo $this->_tpl_vars['lable_config'][$list]['name'] ?>">
							<?php if($this->_tpl_vars['lable_config'][$list]['str']!=''){ ?><span class="cautiontitle"><?php echo $this->_tpl_vars['lable_config'][$list]['str'] ?></span><?php } ?>
						</td>
					</tr>
					<?php } ?>
					<?php }} ?>
				</table>
			</div>
			<div class="sugtitle">
				<span class="sugtitleicon"><span class="strong colorgorning2"><?php echo $this->_tpl_vars['ST']['templatemain_add_mess_label_text2'] ?></span></span>
			</div>
			<div class="sugtitle-line"></div>
			<div class="formdiv">
				<table border="0" width="100%">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01"><?php echo $this->_tpl_vars['ST']['templatemain_add_label_content'] ?></td>
						<td width="85%" class="trtitle02"><textarea name="content" id="content" style="width:98%;height:200px;" class="smallInput"></textarea></td>
					</tr>
				</table>
			</div>
		</div>
	</div>
	<div id="downbotton">
		<div id="subbotton">
			<table border="0" width="100%">
				<tr>
					<td id="right"><input type="submit" id="templateaddsubmit" name="Submit" value="<?php echo $this->_tpl_vars['ST']['botton_cerathtml'] ?>" class="buttonface" /></td>
					<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:parent.onaletdoc();" value="<?php echo $this->_tpl_vars['ST']['botton_cerathtml_reset'] ?>" class="buttonface" /></td>
				</tr>
			</table>
		</div>
	</div>
</form>
</body>

</html>